#!/usr/bin/env python
# -*- coding: utf-8 -*-

import rospy
from ros1_protobuf_msg_bridge.srv import StartPathTeach, StartPathTeachRequest,StartPathTeachResponse

def serv_client():
    rospy.init_node('py_srv_client')
    rospy.wait_for_service('t_srv1')
    try:
        t_srv1 = rospy.ServiceProxy('t_srv1', StartPathTeach)
       # 创建请求对象并设置请求参数
        request = StartPathTeachRequest()
        request.pb.header.timestamp = (3234);
        request.pb.header.frame_id=("frame_id 3234");
        
        # 调用服务并等待响应
        res = t_srv1(request)
        print "ready: ", res.pb.ready
    except rospy.ServiceException, e:
        print "Service call failed: %s" % e

if __name__ == "__main__":
    serv_client()